import _thread
import time
import urllib.request


def tender(postData,delay):
	url = "http://172.16.40.70:8008/ajax/borrows/tender"
	data = urllib.parse.urlencode(postData).encode(encoding='UTF8')
	response = urllib.request.urlopen(url,data)
	print(response)

try:
	_thread.start_new_thread(tender,({"action":"ed6495f7e3acf7e2658bed82c1bc4d7b","borrow_id":"10","card_type":1,"money_num":1600,"pwd":"123456","user_id":"2018020634","sort":1},1))
	_thread.start_new_thread(tender,({"action":"ed6495f7e3acf7e2658bed82c1bc4d7b","borrow_id":"10","card_type":1,"money_num":200,"pwd":"123456","user_id":"2018020636","sort":2},1))
	_thread.start_new_thread(tender,({"action":"ed6495f7e3acf7e2658bed82c1bc4d7b","borrow_id":"10","card_type":1,"money_num":1500,"pwd":"123456","user_id":"2018020635","sort":3},1))
	_thread.start_new_thread(tender,({"action":"ed6495f7e3acf7e2658bed82c1bc4d7b","borrow_id":"10","card_type":1,"money_num":1900,"pwd":"123456","user_id":"2018020638","sort":4},1))
	_thread.start_new_thread(tender,({"action":"ed6495f7e3acf7e2658bed82c1bc4d7b","borrow_id":"10","card_type":1,"money_num":1100,"pwd":"123456","user_id":"2018020634","sort":5},1))
	_thread.start_new_thread(tender,({"action":"ed6495f7e3acf7e2658bed82c1bc4d7b","borrow_id":"10","card_type":1,"money_num":3700,"pwd":"123456","user_id":"2018020638","sort":6},1))
	_thread.start_new_thread(tender,({"action":"ed6495f7e3acf7e2658bed82c1bc4d7b","borrow_id":"10","card_type":1,"money_num":1700,"pwd":"123456","user_id":"2018020635","sort":7},1))
	_thread.start_new_thread(tender,({"action":"ed6495f7e3acf7e2658bed82c1bc4d7b","borrow_id":"10","card_type":1,"money_num":800,"pwd":"123456","user_id":"2018020638","sort":8},1))
	_thread.start_new_thread(tender,({"action":"ed6495f7e3acf7e2658bed82c1bc4d7b","borrow_id":"10","card_type":1,"money_num":1600,"pwd":"123456","user_id":"2018020636","sort":9},1))
except:
	print("Error: 无法启动线程")

while 1:
	pass